# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        黄周云  
# Name:         question04
# Description:
# Author:       ASUS
# Date:         2019/3/2
#-------------------------------------------------------------------------------


str = input("请输入一个大于1的整数：")
i = int(str)
n = 1
m = i*i
numbers1 = []
numbers2 = []
while n<=m:
    numbers2.append(n)
    if n%i==0:
        numbers1.append(numbers2.copy())
        numbers2.clear()
    n+=1
for j in numbers1:
    print(j)
a = 0
b = 0
while a<i:
    while b<i:
        numbers1[a][b],numbers1[b][a]=numbers1[b][a], numbers1[a][b]
        b+=1
    a+=1
for n in numbers1:
    print(n)




